﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Service.Core;

namespace Daily1
{
    public partial class Form1 : Form ,Spring.Context.IApplicationContextAware
    {
        Spring.Context.IApplicationContext context = null;
        
        public Spring.Context.IApplicationContext ApplicationContext
        {
            set { context = value; }
        }

        public Form1()
        {   
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {

            HelloService service = context.GetObject("Hello") as HelloService;

            if (service == null)
            {
                MessageBox.Show("null");
                return;
            }

            MessageBox.Show(service.GetHello("jaehyo"));

            MessageBox.Show(service.SubHello.GetHello("hello2"));

        }
    }
}
